package com.hrhx.servlet;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(name = "Pie3DServlet", urlPatterns = { "/Pie3DDemo" }, loadOnStartup = 1)
public class Pie3DServlet extends HttpServlet {
	private static final long serialVersionUID = 7375363226310112119L;
	
	private Map<String,Object> seriesData;
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		request.setAttribute("seriesData", getSeriesData());
		request.getRequestDispatcher("WEB-INF/views/pie3d.jsp").forward(request, response);
		
	}
	
	public Map<String,Object> getSeriesData(){
		seriesData = new HashMap<String,Object>();
		seriesData.put("<a href=/root/EformAction.do?actionType=open&nid=452881>挂起数量</a>", 335);
		seriesData.put("邮件营销", 310);
		seriesData.put("联盟广告", 234);
		seriesData.put("视频广告", 135);
		seriesData.put("搜索引擎", 1548);
		return seriesData;
	}
}
